<!DOCTYPE html>
<html  xmlns:th="http://www.thymeleaf.org">
<head>
  <meta charset="UTF-8">
  <script src="/layui/layui.js"></script>
  <script src="/js/jquery/jquery-3.5.1.js"></script>
  <script src="/js/book/book.js"></script>
  <link rel="stylesheet" href="/layui/css/layui.css">
  <link rel="stylesheet" href="/css/bookList.css">
  <title>章节更新设置</title>

</head>
<body>
  <form class="layui-form" >
    <div class="layui-form-item">
      <label class="layui-form-label">取值范围</label>
      <div class="layui-input-inline">
        <input type="text" name="range" lay-verify="range" autocomplete="off" placeholder="取值范围" class="layui-input">
      </div>
    </div>

    <div class="layui-form-item">
      <label class="layui-form-label">执行线程数量</label>
      <div class="layui-input-inline">
        <input type="text" name="thread" lay-verify="thread"  class="layui-input">
      </div>
    </div>

    <div class="layui-form-item" style="padding-top: 20px;">
      <div class="layui-input-block">
        <button type="submit" class="layui-btn" lay-submit="" lay-filter="update" style="width: 190px">确定</button>
      </div>
    </div>
  </form>

  <script>
    layui.use('form', function(){
      var form = layui.form;
      //监听提交
      form.on('submit(update)', function(data){
        var rs = JSON.stringify(data.field)
        alert(rs)
        $.ajax({
          type:"post",
          url: "/bookMagic/updateChapter",
          data:JSON.stringify(data.field),
          dataType:"json",
          contentType : "application/json; charset=utf-8",
          success: function(result){
          }
        });
      });
    });
  </script>
</body>

</html>